meta:
  id: ars_parse_detection
  endian: be
seq:
  - id: header
    type: header_str
  - id: body
    type: detection_list
types:
  header_str:
    seq:
      - id: service_id
        type: u2
      - id: method_id
        type: u2
      - id: length
        type: u4
      - id: client_id
        type: u2
      - id: session_id
        type: u2
      - id: protocol_version
        type: u1
      - id: interface_version
        type: u1
      - id: message_type
        type: u1
      - id: return_code
        type: u1
  detection_list:
    seq:
      - id: crch
        type: u4
      - id: crcl
        type: u4
      - id: length
        type: u4
      - id: sqc
        type: u4  
      - id: data_id
        type: u4
      - id: timestamp_nanoseconds
        type: u4
      - id: timestamp_seconds
        type: u4
      - id: timestamp_sync_status
        type: u1
      - id: event_data_qualifier
        type: u4
      - id: extended_qualifier
        type: u1
      - id: origin_invalidflags
        type: u2
      - id: origin_xpos
        type: f4
      - id: origin_xstd
        type: f4      
      - id: origin_ypos
        type: f4
      - id: origin_ystd
        type: f4          
      - id: origin_zpos
        type: f4  
      - id: origin_zstd
        type: f4
      - id: origin_roll
        type: f4
      - id: origin_rollstd
        type: f4      
      - id: origin_pitch
        type: f4
      - id: origin_pitchstd
        type: f4          
      - id: origin_yaw
        type: f4  
      - id: origin_yawstd
        type: f4      
      - id: list_invalidflags
        type: u1  
      - id: list_detections
        type: detection_str
        repeat: expr
        repeat-expr: 800
      - id: list_radveldomain_min
        type: f4  
      - id: list_radveldomain_max
        type: f4 
      - id: list_numofdetections
        type: u4 
      - id: aln_azimuthcorrection
        type: f4   
      - id: aln_elevationcorrection
        type: f4  
      - id: empty
        type: u1
        repeat: eos
  object_list:
    seq:
      - id: empty
        type: u1
        repeat: eos
  detection_str:
    seq:
      - id: f_azimuthangle
        type: f4
      - id: f_azimuthanglestd
        type: f4
      - id: u_invalidflags
        type: u1
      - id: f_elevationangle
        type: f4
      - id: f_elevationanglestd
        type: f4
      - id: f_range
        type: f4
      - id: f_rangestd
        type: f4
      - id: f_rangerate
        type: f4  
      - id: f_rangeratestd
        type: f4      
      - id: s_rcs
        type: s1
      - id: u_measurementid
        type: u2
      - id: u_positivepredictivevalue
        type: u1   
      - id: u_classification
        type: u1     
      - id: mulitargetprobability
        type: u1
      - id: u_objectid
        type: u2
      - id: u_ambiguityflag
        type: u1
      - id: u_sortindex
        type: u2

      
      